$(function () {
    selectList();
});

/*课程查询*/
function selectList() {  
    var datas = {
        interface:'Product@productList',
        fundType:'2'
    };

    common.ajax({
        data: datas,
        success: function (data) {
            if (data.status == '2000') {  
                var list = data.result.productList;       
                var html = '<h2 class="p-title ellipsis">'+data.result.partner_name+'</h2><ul class="list">'
                for(var i= 0;i<list.length;i++){
                    var item = list[i];
                        html += '<li class="fq"> <a class="clearfix" href="/secoo/product_bill?p_name='+item.p_name+'&b_borrow_amount='+item.p_set_amount+'">'
                        html += '<img class="fl" src="/static/images/list_bg_0.png"/>'
                        html += '<div class="list-table fl">'
                        html += '<p class="w40 p-name">'+item.p_name+'</p>'
                        html += '<p class="price w20 text-center">¥<i class="b-borrow-amount">'+item.p_set_amount+'</i></p>'
                        html += '<p class="w15"><span class="pay-btn">去申请</span></p>'
                        html += '</div>'
                        html += '</a></li>'
                }
                html += '</ul>'
                $(html).appendTo($("#mechanism"));
            } else if (data.status == '5000') {
                falert(data.msg);
            }
        }
    });  
}
